{extend name="default/template/base_index"/}

{block name="area_header"}
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/wxshop.css">
    <link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/select2.min.css" />
    <link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/cosmo-skin.css" />
{/block}

{block name="area_body"}

    <div class="admin-main container-fluid">

        <div class="admin-main-content col-lg-8 offset-col-lg-2">
            {include file="default/Widget/breadcrumb" /}
            <!-- 过滤\查询按钮 -->
            <div class="filter-controls">
                <form action="{:url('PicSearch/index')}" method="post" class="form" id="tpsch">
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">提交人</div>
                            <div class="col-lg-3 col-md-3">
                                <input type="text" name="username" placeholder="请输入提交人姓名！" class="form-control" value="{$username}" />
                            </div>
                            <button type="submit" class="btn btn-default"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group" >
                            <div class="input-group-addon">评价状态</div>
                            <div class="col-lg-3 col-md-3">
                                <div class="form-control">
                                    <label class="radio-inline">
                                        <input type="radio" name="op_status" id="op_status1" value="0" class="op_status"
                                        <eq name="op_status"
                                            value="0">checked="checked"
                                        {/eq}
                                        />尚未处理
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" name="op_status" id="op_status2" value="1" class="op_status"
                                        <eq name="op_status"
                                            value="1">checked="checked"
                                        {/eq}
                                        />正在处理
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
            <!-- 操作按钮 -->
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <a class="btn btn-danger btn-sm ajax-post confirm" href="{:url('PicSearch/bulkDelete')}"
                       target-form="selectitem"><i class="fa fa-trash-o"></i>批量删除内容</a>
                </div>
            </div>
            <table class="table table-striped table-hover table-condensed">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');"/>全选
                    </th>
                    <th>
                        提交人
                    </th>
                    <th>
                        联系方式
                    </th>
                    <th>
                        简述
                    </th>
                    <th>
                        创建时间
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                {empty name="list"}
                    <tr>
                        <td colspan="5" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    {else/}
                    {volist name="list" id="vo"}
                        <tr>
                            <td>
                                <input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem"/>{$vo.id}
                            </td>
                            <td>
                                {$vo.username}
                            </td>
                            <td>
                                {$vo.contact_addr}
                            </td>
                            <td>
                                {$vo.desc}
                            </td>
                            <td>
                                {$vo.create_time|date="Y年m月d日 H:i:s",###}
                            </td>
                            <td>
                                <a class="confirm ajax-post btn btn-primary btn-sm"
                                   href="{:url('PicSearch/detail',array('id'=>$vo['id'],username=>$vo['username']))}"
                                   target-form=""><i
                                        class="fa fa-plus"></i>查看详情</a>
                                <eq name="vo.op_status" value="0">
                                    <a class="confirm ajax-post btn btn-primary btn-sm"
                                       href="{:url('PicSearch/setcompleted',array('id'=>$vo['id']))}"
                                       target-form=""><i class="fa fa-plus"></i>设为已处理</a>
                                {/eq}
                                <eq name="vo.op_status" value="1">
                                    <a class="confirm ajax-post btn btn-danger btn-sm"
                                       href="{:url('PicSearch/setincomplete',array('id'=>$vo['id']))}"
                                       target-form=""><i class="fa fa-plus"></i>设为未处理</a>
                                {/eq}
                                <a class="confirm ajax-post btn btn-primary btn-sm"
                                   href="{:url('PicSearch/del',array('id'=>$vo['id']))}" target-form=""><i
                                        class="fa fa-plus"></i>删除</a>
                            </td>
                        </tr>
                    {/volist}
                {/empty}
                </tbody>
            </table>
            <div>{$show}</div>

        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
{/block}

{block name="area_footer"}
    <script>
        $(function () {
            $(":radio").click(function () {
                $('#tpsch').submit();
            })
        })
    </script>
{/block}